Skip to content

Conversation

@sandorsett
Copy link

fixes #286724
This change implements a new option so callers can submit a chat request and immediately return the UI to an empty/new chat view (submit in background). It addresses https://github.com//issues/286724.

Adds IChatAcceptInputOptions.sendToNewChat?: boolean.
When set, ChatWidget captures the session, cancels any in-flight request for that session, clears the widget (returns UI to empty chat), and submits the request to the original session resource in the background.
Updates SendToNewChatAction to delegate to widget.acceptInput(..., { sendToNewChat: true }) instead of manual clear+submit.
Adds unit tests validating delegation and the _acceptInput send+clear behavior.

* If true, submit the input to the associated session and clear the widget (show empty/new chat) immediately.
* This allows sending a request 'in the background' while returning the UI to an empty chat view.
*/
sendToNewChat?: boolean;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this name backwards? It's not sending to a new chat, it's sending to the current chat then opening a new chat... I will have to think of a catchy name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat: support an action to send a chat request and clear widget

2 participants